#ifndef __LOCK_H__
#define __LOCK_H__

#ifdef LINUX
#include <pthread.h>
#endif

struct bs_mutex 
{
#ifdef LINUX
	pthread_mutex_t os_mutex;
#endif
#ifdef WIN32
	int os_mutex;
#endif
};



#ifdef LINUX
#define bs_lock(mtx)  do { \
	pthread_mutex_lock(&(mtx.os_mutex)); \
} while (0)
#elif defined(WIN32) 
#define bs_lock(mtx)  do { \
} while (0)
#endif


#ifdef LINUX
#define bs_unlock(mtx) do { \
	pthread_mutex_unlock(&(mtx.os_mutex)); \
} while (0)
#elif defined(WIN32)
#define bs_unlock(mtx) do { \
} while (0)
#endif


extern struct bs_mutex g_log_mutex;

#endif //__LOCK_H__